import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const Index = () => import("@/views/index/index")
const Cars = () => import("@/views/cars/cars")
const User = () => import("@/views/user/user")
const Safe = () => import("@/views/safe/index")
const Bank = () => import("@/views/safe/bank")
const BankAdd = () => import("@/views/safe/bankAdd")
const Capital = () => import("@/views/safe/capital")
const My = () => import("@/views/safe/password")

const routes = [
  {
    path: '/',
    component: Index,
    name: "Index",
    children: [
      { path: '/cars', name: "cars", component: Cars },
      { path: '/user', name: "user", component: User },
      { path: '/safe', name: "safe", component: Safe },
      { path: '/my', name: "my", component: My },
      { path: '/bank', name: "bank", component: Bank },
      // { path: '/bankAdd', name: "bankAdd", component: BankAdd },
      { path: '/capital', name: "capital", component: Capital },
    ]
  },
]

const router = new VueRouter({
  routes,
  mode: "history"
})

export default router
